
from django.shortcuts import render,HttpResponse

# Create your views here.
# 查询字符串:http://127.0.0.1:8000/book?id=3
def book_detail_query_string(request):
     # request.GET = {"id":3}
    book_id = request.GET.get('id')
    return HttpResponse(f"<h1>你查找的图书id是：{book_id}</h1>")


# 在path中携带:http://127.0.0.1:8000/book/2
def book_detail_path(request,book_id):
    return HttpResponse(f"你查找的图书id是：{book_id}")

def book_detail_str(request,book_id):
    return HttpResponse(f"你查找的图书id是：{book_id}")

def book_detail_slug(request,book_id):
    return HttpResponse(f"你查找的图书id是：{book_id}")

def book_path(request,book_id):
    return HttpResponse(f"你查找的图书id是：{book_id}")